﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AllNations
{
    public partial class EducationHome : MakeItWeb.Framework.MakeItWebPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // sitemap
            var sitemapMenu = radMenuLeftNav.Items.FindItemByValue("SundaySchoolResources");
            sitemapMenu.Visible = IsInRole("SundaySchoolTeacher");
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString.ToString()))
                {
                    var item = radMenuLeftNav.Items.FindItemByValue(Request.QueryString.ToString());
                    if (item != null)
                    {
                        ANMCPageViews.SelectedIndex = item.Index;
                        item.Selected = true;
                    }
                }
            }
        }

        protected void radMenuLeftNav_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
        {
            ANMCPageViews.SelectedIndex = e.Item.Index;
        }
    }
}